dma-trace: Allow DMA re-configuration#4850
Merged
lgirdwood merged 2 commits intothesofproject:mainfrom Oct 12, 2021
Merged
Conversation
Collaborator
|
What is the simplest way to test this? |
Contributor
Author
my wip branch is kept up to date with sof-dev: Build it, reboot if needed. And repeat the module removal/insert |
ranj063
reviewed
Oct 6, 2021
a58736b to
1074b03
Compare
After the dma_copy_set_stream_tag() a DMA channel is requested, release it in any of the error cases later. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1074b03 to
ac94e38
Compare
Contributor
Author
|
Changes since v1:
|
Member
|
Seems CI is stuck. Restart it. |
Member
|
SOFCI TEST |
ranj063
approved these changes
Oct 7, 2021
marc-hb
reviewed
Oct 7, 2021
src/trace/dma-trace.c
Outdated
Collaborator
There was a problem hiding this comment.
Could adding some reference to the channel in the log be helpful?
ac94e38 to
c30112b
Compare
Contributor
Author
|
Changes since v2:
|
lyakh
reviewed
Oct 8, 2021
src/trace/dma-trace.c
Outdated
Collaborator
There was a problem hiding this comment.
just use else if to avoid repeating err == 0?
Contributor
Author
There was a problem hiding this comment.
Yes, that is a cleaner way.
The host will receive an error if it tries to re-configure the dtrace: [ 22736132.117381] ( 28.645832) c0 hda-dma ..../intel/hda/hda-dma.c:489 ERROR hda-dmac: 4 no free channel 0 [ 22736147.377797] ( 15.260416) c0 dma-copy src/ipc/dma-copy.c:163 ERROR dma_copy_set_stream_tag(): dc->chan is NULL [ 22736180.346545] ( 32.968750) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -22 Since we try to request an already used channel. If we skip the requesting then we will fail with the configuration: [ 31707957.542122] ( 27.447916) c0 dma-copy src/ipc/dma-copy.c:162 ERROR dma_copy_set_stream_tag(): already have chan for stream_tag 1 [ 31708021.917120] ( 64.375000) c0 hda-dma ..../intel/hda/hda-dma.c:539 ERROR hda-dmac: 4 channel 0 busy. dgcs 0x800000 status 5 [ 31708056.083785] ( 34.166664) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -16 To support the reconfiguration: if we have DMA channel for dtrace, stop it to allow the reconfiguration. In the unlikely case when the stream_id has changed, release the channel as well and request a new one. Tested with the SOF client kernel by rmmod and modprobe the dtrace client during active audio playback to prevent the DSP to be turned off. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
c30112b to
69f2d54
Compare
Contributor
Author
|
Changes since v3:
|
lyakh
approved these changes
Oct 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The host will receive an error if it tries to re-configure the dtrace:
[ 22736132.117381] ( 28.645832) c0 hda-dma ..../intel/hda/hda-dma.c:489 ERROR hda-dmac: 4 no free channel 0
[ 22736147.377797] ( 15.260416) c0 dma-copy src/ipc/dma-copy.c:163 ERROR dma_copy_set_stream_tag(): dc->chan is NULL
[ 22736180.346545] ( 32.968750) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -22
Since we try to request an already used channel. If we skip the requesting
then we will fail with the configuration:
[ 31707957.542122] ( 27.447916) c0 dma-copy src/ipc/dma-copy.c:162 ERROR dma_copy_set_stream_tag(): already have chan for stream_tag 1
[ 31708021.917120] ( 64.375000) c0 hda-dma ..../intel/hda/hda-dma.c:539 ERROR hda-dmac: 4 channel 0 busy. dgcs 0x800000 status 5
[ 31708056.083785] ( 34.166664) c0 ipc src/ipc/ipc3/handler.c:805 ERROR ipc: failed to enable trace -16
To support the reconfiguration:
if we have DMA channel for dtrace, stop it to allow the reconfiguration.
In the unlikely case when the stream_id has changed, release the channel
as well and request a new one.
Tested with the SOF client kernel by rmmod and modprobe the dtrace client
during active audio playback to prevent the DSP to be turned off.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@linux.intel.com